<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>{$pagetitle}</title>
        <meta name="renderer" content="webkit" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <link rel="stylesheet" href="/static/admin/layuiadmin/layui/css/layui.css" media="all" />
        <link rel="stylesheet" href="/static/admin/css/admin_global.css" />
        <link rel="stylesheet" href="/static/admin/plugin/select2/css/select2.min.css" />
        <link rel="stylesheet" href="/static/admin/plugin/fancybox/jquery.fancybox-1.3.4.vot.css" />
        <link rel="stylesheet" href="/static/admin/plugin/jsmind-master/style/jsmind.css" />
        <style> table{ table-layout: fixed; } td,th { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } </style>
    </head>
    <body>
        <div class="layui-fluid padding-top-20">
            <div class="layui-card">
                <div class="layui-form-header">
                    <div class="header-left" id="header-left"><span class="layui-btn iframe " data-href="{:url('add',['robot_conversation_message__id'=> $v.robot_conversation_message__id])}" data-title="机器人聊天对话消息-新增" data-msg="确认操作吗？" data-height="100%" data-width="100%">新增</span></div>
                    <div class="header-right">
                        <form action="{:url()}" method="get" class="layui-form-pane" id="header-right">
                            <div class="layui-inline">
                                <label class="layui-form-label">回答时间</label>
                                <div style="display: flex;" class="layui-input-inline">
                                    <input type="text" name="robot_conversation_message__answer_time_start" id="robot_conversation_message__answer_time_start" autocomplete="false" class="layui-input form-date" readonly placeholder="开始回答时间" data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss" value="{:input('robot_conversation_message__answer_time_start')}" />
                                    <input type="text" name="robot_conversation_message__answer_time_end" id="robot_conversation_message__answer_time_end" autocomplete="false" class="layui-input form-date" readonly placeholder="结束回答时间" data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss" value="{:input('robot_conversation_message__answer_time_end')}" />
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">事件id</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="robot_conversation_message__event_id" id="robot_conversation_message__event_id" autocomplete="false" class="layui-input" placeholder="请输入事件id" value="{:input('robot_conversation_message__event_id')}" />
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">是否事件提交</label>
                                <div class="layui-input-inline">
                                    <select name="robot_conversation_message__is_event_submission" id="robot_conversation_message__is_event_submission" autocomplete="false" class="select2" lay-ignore style="min-width: 100px;">
                                        <option value="">请选择</option>
                                        {foreach $robot_conversation_message__is_event_submission_options as $option} 
                                        <option value="{$option.id}" {$Request.param.robot_conversation_message__is_event_submission == $option.id ? 'selected': ''}>{$option.name}</option>
                                        {/foreach} 
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">机器人</label>
                                <div class="layui-input-inline">
                                    <select name="robot__id" id="robot__id" autocomplete="false" class="select2" lay-ignore style="min-width: 100px;">
                                        <option value="">请选择</option>
                                        {foreach $robot__id_options as $option} 
                                        <option value="{$option.id}" {$Request.param.robot__id == $option.id ? 'selected': ''}>{$option.name}</option>
                                        {/foreach} 
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">机器人聊天对话</label>
                                <div class="layui-input-inline">
                                    <select name="robot_conversation__id" id="robot_conversation__id" autocomplete="false" class="select2" lay-ignore style="min-width: 100px;">
                                        <option value="">请选择</option>
                                        {foreach $robot_conversation__id_options as $option} 
                                        <option value="{$option.id}" {$Request.param.robot_conversation__id == $option.id ? 'selected': ''}>{$option.name}</option>
                                        {/foreach} 
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <button type="submit" class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="LAY-app-contlist-search"> <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> </button>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="layui-card-body">
                    <form class="layui-form" lay-filter="component-form-element" action="{:url()}" method="post" onsubmit="return save_form(this);">
                        <table class="layui-table" lay-filter="table1">
                            <thead>
                                <tr id="table-header">
                                    <th style="width: 50px;">编号</th>
                                    <th>用户提问</th>
                                    <th>机器回答</th>
                                    <th>引用文件</th>
                                    <th>是否好评</th>
                                    <th>回答时间</th>
                                    <th>事件id</th>
                                    <th>是否事件提交</th>
                                    <th>事件详情</th>
                                    <th>用户提交</th>
                                    <th>相似度</th>
                                    <th>机器人名称</th>
                                    <th>机器人聊天对话名称</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody id="table-body">
                                {foreach $data as $v} 
                                <tr>
                                    <td title="{$v.robot_conversation_message__id}">{$v.robot_conversation_message__id}</td>
                                    <td title="{$v.robot_conversation_message__user_questions}">{$v.robot_conversation_message__user_questions}</td>
                                    <td title="{$v.robot_conversation_message__machine_answer}">{$v.robot_conversation_message__machine_answer}</td>
                                    <td title="{$v.robot_conversation_message__referenced_files}">{$v.robot_conversation_message__referenced_files}</td>
                                    <td>
                                        <?php
$robot_conversation_message__is_positive_reviews_map = [ 1 =>
                                            '是', 0 => '否',
];
?> {if $v.robot_conversation_message__is_positive_reviews!==''} {$robot_conversation_message__is_positive_reviews_map[$v.robot_conversation_message__is_positive_reviews]} {else/} - {/if} 
                                        </td>
                                        <td title="{$v.robot_conversation_message__answer_time}">{$v.robot_conversation_message__answer_time}</td>
                                        <td title="{$v.robot_conversation_message__event_id}">{$v.robot_conversation_message__event_id}</td>
                                        <td>
                                            <?php
$robot_conversation_message__is_event_submission_map = [ 1 =>
                                                '是', 0 => '否',
];
?> {if $v.robot_conversation_message__is_event_submission!==''} {$robot_conversation_message__is_event_submission_map[$v.robot_conversation_message__is_event_submission]} {else/} - {/if} 
                                            </td>
                                            <td title="{$v.robot_conversation_message__event_details}">{$v.robot_conversation_message__event_details}</td>
                                            <td title="{$v.robot_conversation_message__user_submission}">{$v.robot_conversation_message__user_submission}</td>
                                            <td title="{$v.robot_conversation_message__similarity}">{$v.robot_conversation_message__similarity}</td>
                                            <td title="{$v.robot__name}">{$v.robot__name}</td>
                                            <td title="{$v.robot_conversation__name}">{$v.robot_conversation__name}</td>
                                            <td>
<span class="layui-btn layui-btn-sm iframe " data-href="{:url('update',['robot_conversation_message__id'=> $v.robot_conversation_message__id])}" data-title="机器人聊天对话消息-修改" data-msg="确认操作吗？" data-height="100%" data-width="100%">修改</span>
<span class="layui-btn layui-btn-sm layui-btn-danger ajax_del " data-href="{:url('delete',['robot_conversation_message__id'=> $v.robot_conversation_message__id])}" data-title="机器人聊天对话消息-删除" data-msg="确认删除操作吗？？" data-height="100%" data-width="100%">删除</span>
</td>
                                        </tr>
                                        {/foreach} 
                                    </tbody>
                                </table>
                                <div class="layui-inline" id="table-footer"></div>
                            </form>
                            <div class="layui-box layui-laypage layui-laypage-default" id="table-paginate">{$paginate|raw}</div>
                        </div>
                    </div>
                </div>
                <script src="/static/admin/layuiadmin/layui/layui.js"></script>
                <script src="/static/js/jquery-3.6.2.min.js"></script>
                <script src="/static/admin/plugin/select2/js/select2.full.min.js"></script>
                <script src="/static/js/crypto-js.min.js"></script>
                <script src="/static/admin/js/global.js"></script>
                <script src="/static/admin/plugin/fancybox/jquery.easing-1.3.pack.js"></script>
                <script src="/static/admin/plugin/fancybox/jquery.fancybox-1.3.4.vot.js"></script>
                <script src="/static/admin/plugin/shengshiqu/distpicker.data.js"></script>
                <script src="/static/admin/plugin/shengshiqu/distpicker.js"></script>
                <script src="/static/admin/js/openfile.js"></script>
                <script src="/static//admin/js/check.js"></script>
                <script src="/static/admin/plugin/jsmind-master/js/jsmind.js"></script>
                <!--文件上传 start-->
                <script src="/static/admin/plugin/webuploader/kinderfile.js"></script>
                <script src="/static/admin/plugin/webuploader/Sortable.js"></script>
                <script src="/static/admin/plugin/webuploader/morepic.js"></script>
                <!--以下是针对 快速上传单个文件插件-->
                <link rel="stylesheet" href="/static/admin/plugin/webuploader/style/webuploader.css" />
                <link rel="stylesheet" href="/static/admin/plugin/webuploader/style/style.css" />
                <script src="/static/admin/plugin/webuploader/webuploader.min.js"></script>
                <script src="/static/admin/plugin/webuploader/fastupimg.js"></script>
                <script>
  function playVideoSrc(src) {
    if(src){
      $.fancybox({
        content:'<div class="fancybox_video_play"><video  style="width:100%;height:600px" id="fancybox_video_src" src="'+src+'" autoplay controls></video></div>',
      })
    }else{
      layer.msg("视频地址为空");
    }
  }
</script>
                <script>

  $(document).ready(function() {
    $("a.fancybox").fancybox();
    $('.select2').select2();
  })

  layui.laydate.render({
    elem: '.form-date'
  })

</script>
                <script id="js1"></script>
                <script>
  function exportTable(){
    // 使用outerHTML属性获取整个table元素的HTML代码（包括<table>标签），然后包装成一个完整的HTML文档，设置charset为urf-8以防止中文乱码
    var html = "<html><head><meta charset='utf-8' /></head><body>" + document.getElementsByTagName("table")[0].outerHTML + "</body></html>";
    // 实例化一个Blob对象，其构造函数的第一个参数是包含文件内容的数组，第二个参数是包含文件类型属性的对象
    var blob = new Blob([html], { type: "application/vnd.ms-excel" });
    var a = document.getElementById("download_a");
    // 利用URL.createObjectURL()方法为a元素生成blob URL
    a.href = URL.createObjectURL(blob);
    // 设置文件名
    a.download = "{$exportName}.xls";
    a.click()
  }
</script>
            </body>
        </html>